// components/image/index.js
Component({
  externalClasses: ['pla-class', 'extra-class'],
  options: {
    addGlobalClass: true
  },
  /**
   * 组件的属性列表
   */
  properties: {
    image: {
      type: Object,
      value: {}
    },
    mode: {
      type: String,
      value: "widthFix"
    },
    scale: {
      type: Boolean,
      value: false,
    }
  },

  lifetimes: {
    ready: function () {},
    attached: function () {
      // 在组件实例进入页面节点树时执行
    },
    detached: function () {
      // 在组件实例被从页面节点树移除时执行
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    loaded: false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    finishLoad() {
      setTimeout(() => {
        this.setData({
          loaded: true
        });
      }, 700);
    },
  }
})